<%@page import="cn.sendto.dbhelper.DBHelper"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
  //
  
  request.setCharacterEncoding("UTF-8");
  String id = request.getParameter("scoreid");
  String course = request.getParameter("course");
  String stuname = request.getParameter("studentname");
  String score = request.getParameter("score");
  String stuid = request.getParameter("studentid");
  //实例化操作数据库的类DBHelper
  DBHelper helper = new DBHelper();
  
  //定义SQL语句
  String sql = "update scoreinfo set score= ? where scoreid = ?";
  
  //返回执行影响行数
  int rows = helper.executeSQL(sql, score,id);
  
  if(rows>0)
  {
	  request.setAttribute("massage", "修改成功");
	  request.getRequestDispatcher("score_list.jsp?id="+stuid).forward(request, response);
  }
  else
  {
	  request.setAttribute("massage", "对不起，修改失败,请与管理员联系！");
	  request.getRequestDispatcher("modifyscore.jsp?id="+stuid).forward(request, response);
  }
%>